/* ----------------------------------------------------------------------------------------------------------------
 * AbstractScenery
 * ----------------------------------------------------------------------------------------------------------------
 */
package pure.engine.scenery 
{
	import flash.display.BitmapData;
	
	/**
	 * 抽象布景
	 * @author Pure
	 */
public class AbstractScenery implements IScenery
{
	public function AbstractScenery(type:String) 
	{
		_type = type;
	}
	
	
	protected var _sceneryBuffer:BitmapData;

	protected var _type:String;

	
	
	
	public function destroy():void
	{
		if (_sceneryBuffer)
		{
			_sceneryBuffer.dispose();
			_sceneryBuffer = null;
		}
	}


	public function get sceneryBuffer():BitmapData
	{
		if (_sceneryBuffer == null)
		{
			_drawScenery();
		}
		
		return _sceneryBuffer;
	}
		
		
	public function get width():Number { return this.sceneryBuffer.width; }
	public function get height():Number { return this.sceneryBuffer.height; }
	public function get type():String { return _type; }


	/**
	 * @inheritDoc
	 */
	protected function _drawScenery():void
	{
	}
	
}

}